<?php 
ob_start();
include("connection/connection.php");
$frm=$_POST['frmId'];
$DP_population=$_POST['DP_population'];
$distId =  $_POST['district_id'];
$lpcd=$_POST['service'];
$pop = $DP_population*$lpcd;

$qr="update tbl_dtls_q2_main set DP_population='$DP_population',DP_water_demand='$pop' where id='$frm'";
$res=mysql_query($qr);
$qryHistory="insert into tbl_new_user_history(user_id,form_id,action_id,ip_address,modify_date,user_type,user_name) values('$_POST[loginId]','$frm','107','$_SERVER[REMOTE_ADDR]',NOW(),'$_POST[userType]','$_POST[name]')";
mysql_query($qryHistory);
if($res)
{
header("Location:q2.php");
}

?>